package com.example.userpointmgr.controller;

import com.example.userpointmgr.service.GroupService;
import com.example.userpointmgr.tool.ResponseResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class GroupController {
    @Autowired
    private GroupService groupService;

    @GetMapping("/grouplist")
    @ApiOperation("获取全部分组")
    public ResponseResult findAll() {
        return ResponseResult.success(groupService.findAllGroups());
    }
}
